﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public static class VectorExtension  {

    public static float SqrDistance(this Vector3 a, Vector3 b)
    {
        return Vector3.SqrMagnitude(a - b);
    }


    //public static float sqr(this float f)
    //{
    //    return f * f;
    //}


    public static bool DistanceLessThan(this Vector3 a,Vector3 b,float distance)
    {
        return (a - b).sqrMagnitude < distance * distance ? true : false;
    }

    public static bool DistanceGreaterThan(this Vector3 a, Vector3 b, float distance)
    {
        return !DistanceLessThan(a, b, distance);
    }

    public static bool EqualZeroVector(this Vector3 a)
    {
        return a == Vector3.zero;
    }



}
